package huoye.shops.huoye.message.networt;



import com.codeideology.android.http.okhttp.OkHttpUtils;
import com.codeideology.android.lang.entity.Paging;

import java.util.HashMap;
import java.util.Map;

import huoye.shops.base.APIUrls;
import huoye.shops.base.BaseService;
import huoye.shops.base.MineBaseJsonRequestCallback;
import huoye.shops.common.model.SMSCoder;
import huoye.shops.huoye.message.model.MessageShowData;
import huoye.shops.huoye.mine.model.PowerList;
import huoye.shops.huoye.operation.model.ManageEventData;
import huoye.shops.huoye.user.model.SelectCityData;
import huoye.shops.huoye.user.model.UpdateInfo;
import huoye.shops.huoye.user.model.User;


/**
 * Created by user on 2017/7/24.
 */

public class MessageService extends BaseService {

    /**
     * 设置商家消息已读
     *
     * @param msgId
     * @param callback
     */
    public void setShopMessage(String msgId, MineBaseJsonRequestCallback<MessageShowData> callback) {
        Map<String, String> param = new HashMap<>();

        setUserShopId(param);
        param.put("msgId",msgId);

        OkHttpUtils.getInstance().post()
                .url(getUrl(APIUrls.MESSAGE.TYPE_MESSAGE_POSH_SET_SHOP_MSG))
                .params(param)
                .build().execute(callback);
    }

     /**
     *    获取商家消息中心
     *
     * @param paging
     * @param callback
     */
    public void postShopMessage(Paging paging, MineBaseJsonRequestCallback<MessageShowData> callback) {
        Map<String, String> param = new HashMap<>();

        setUserShopId(param);
        setPaging(param,paging);

        OkHttpUtils.getInstance().post()
                .url(getUrl(APIUrls.MESSAGE.TYPE_MESSAGE_POSH_SHOP_MESSAGE))
                .params(param)
                .build().execute(callback);
    }


    /**
     * 获取当前用户的权限列表
     *
     * @param callback
     */
    public void getUserPowers( MineBaseJsonRequestCallback<PowerList> callback) {
        Map<String, String> param = new HashMap<>();

        setUser(param);

        OkHttpUtils.getInstance().post()
                .url(getUrl(APIUrls.OPERATION.TYPE_OPERATION_POST_USER_POWERS))
                .params(param)
                .build().execute(callback);
    }




}


